#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <string.h>


int main(int argc, char** argv)
{
FILE *file;
 file = fopen("rand_data.txt","w"); /* apend file (add text to
a file or create a file if it does not exist.*/
 srand ( time(NULL) );
 int i,random;
 fprintf(file,"%s ",argv[1]);
 for(i = 0;i < atoi(argv[1]);i++){
   random = rand() % atoi(argv[1]);
   fprintf(file,"%d ",random); /*writes*/
 }
fclose(file); /*done!*/

return 0;
}
